Continuous Distributions

In continuous distributions, every outcome has probability zero. And that might sound entirely counterintuitive and it is, but it is important to understand.

Range Probability

So let’s now redefine how to treat continuous distributions, here is our circle again and here is the bottle that we are spinning. Let’s call the outcome X, that’s the final angle at which the bottle arrives. Tell me what’s the probability that X is between zero and 180 degrees?

Answer

  • So, obviously, the probability for any interval, defined by A and B, is the size of the interval divided by 360

Screenshot taken from Udacity

Density

  • Density of a probability: it’s kind of like a probability for continuous spaces but not exactly. It’s just a good motivator to think of a density as a – of a probability for continuous spaces.
  • Let’s take the bottle example. We know that the outcome of turning the bottle lies between 0 and 360 degrees.
  • So, given what we learnt, you want to assign 0 to anything outside that range but inside this range, we’d love to give a value and say, look, there is a function here that renders every outcome in this interval equally likely.
  • So, you’re going to construct this function for c number one, each outcome in the range of 0 to 360 has an equal value, and, constraint number two, the area under this function sums up or integrates to 1 which means this area over here is just 1.

Answer

  • And, the answer is, again, 0.002777, which is the same as 1 over 360.
  • And, the way to see this is that the width of this interval over here is 360. We didn’t know the height which is what I asked you to guess. But, if we multiply 360 by 1 over 360 then the area of this rectangle over here becomes 1.

Screenshot taken from Udacity

Quiz: Birth Time Density

  • Suppose, you look at the date and time you were born, and then specifically look not at the date , not even the time, but just the seconds of the time. So, it could be that we were born exactly as the minute began, in which case, it was zero ; or exactly at second 59.282, I don’t know.
  • Let’s assume it’s completely uniform. There is no preference to be born early in the minute or late in the minute. I’m going to ask you two questions now. For any such 9thing, X, where X is the seconds of the timestamp , what’s the probability of that specific X ? And, what’s the density of that specific X?

Answer

  • And, the correct answer here is 0. Any specific continuous thing, 0.
  • For uniform distribution, we find that the interval we’re talking about skates between 0 and 60 so the correct answer is 1 over 60 and that is 0.01666.

Screenshot taken from Udacity

Quiz: Changing Density

  • So, here’s a new quiz and in this quiz you’ll be looking into densities that are non-uniform. In particular, I’m looking at the time of day when people are born. And, let’s assume for this exercise that it’s twice as likely to be born before noon than in the afternoon or the evening.
  • So, if you look at the time of day and the density for the time of day, I wonder if the shape is like this. This is zero and this is midnight, right at 24.

Screenshot taken from Udacity

  • And, now, comes the hard part. I want you to calculate the actual density. We know that the density for the birth time to be before noon is twice as large as the density for being born after noon.
  • So, here is my density function, time of day X, Nf of X and you’ve already identified the shape. And, there’s now two parameters, A and B. I want you to figure out for me what A is and what B is, assuming that the basic unit here is in hours. Put differently, there is 24 hours horizontally in this interval.
  • As a hint, make sure that the area underneath sums up to 1.

Answer

  • And, here’s how I calculate it. These spheres over here are all of the same volume. Since they have to add up to 1, each of those has exactly a third (1/3).
  • Now, let’s start with the right one. If this is a third in terms of area and we have to cover 12 hours, then B equals to 1/3 1/12 = 0.0277. The one on the left is exactly twice the size, 0.0555 which is 2/3 1/12, it’s 1/18th.

Screenshot taken from Udacity

Quiz: Check Density

If we multiply A by 12 because the density over here applies to 12 hours, plus B by times 12, tell me what the resulting number is.

Answer

  • And, I hope you got this right as, of course, because the surface area has to add up to 1. This was to cross-check over here, whereby 1/18th times 12 is two-thirds and 1/36 times 12 is one-third, and two-thirds plus one-thirds equals 1.
  • So, this was an example of a non-uniform density that you were able to compute. As you can tell, each specific birth time has exactly a probability of zero and this is just a density.

Screenshot taken from Udacity

Quiz: Calculate Density

  • Here’s another quiz. You’re dropping a package out of an aircraft, and the package goes down and we happen to know it takes between 3 and 3.5 minutes to reach the ground.
  • And, let’s say, in between the probability density is uniform. Asking the same question again. There’s something to be learnt here. Here is 3. Here is 3.5. Obviously, the density outside is zero, is uniform, and there’s a value here A. And, I want you to tell me what is A.

Answer

  • And in my calculation A is 2.
  • And, the reason is the normalizer over here is a half, from three to three and a half. To multiply a half with 2 gives us the area of 1 which is what we want to have for density.
  • Now, what’s interesting here? A is larger than 1. Probabilities are never larger than 1. They are bound to the above by 1. But, densities can be larger than 1.
  • In fact, if this package were to arrive between 3 minutes and 3 minutes and 1 second, then this would be 60 because there are 60 seconds in a minute.
  • So, it is possible that densities become larger than 1; that’s a bit confusing if you think it was probability.

Screenshot taken from Udacity

Quiz: Density Properties

Let me ask another trick question and that’s somewhat academic. For function f to qualify as an entity which of the conditions have to be fulfilled: has to be positive, non-negative, continuous, and smaller or equal to 1?

Answer

  • And, this is a really tricky question. So, clearly, densities don’t have to be positive 5everywhere. It suffices to be non-negative and I gave you examples where outside of certain interval density was zero. Zero is not positive. Zero is just non-negative.
  • Now, densities don’t have to be continuous. I gave you an example of a density like this. And, over here where the density jumped, you had a point of discontinuity. So, continuous is not correct. And, if you got this wrong, no big deal. The word continuous might not even mean much to you. But, it’s one of these things to know about densities.
  • Now, smaller or equal to 1, that’s a really tricky one. And, I would submit that’s not correct and here’s why. Suppose you have a density that assigns uniform probability only to values between 0 and 0.1, then the height of this density could be 10; it’s 1 over 0.1. And, as a result, it’s possible that densities can exceed 1. And that is a key point that makes them different from probabilities. Probabilities are always smaller than or equal to 1. Densities can be larger than 1.

Screenshot taken from Udacity

Summary

  • So you just learned about the concept of a probability density and that’s very cool. You now know what a uniform density is, you’ve encountered a new type of density that have a step in the middle and later in this class we will see densities that are very funny like this one over here called the Gaussian.
  • We get back to this after we talked about large numbers and something funky called the central limit theorem or CLT.

Screenshot taken from Udacity